<template>
  <div class="classmeta">
    <Card>
      <span>状态：</span>
      <Select v-model="status" clearable style="width:200px">
        <!-- <Option v-for="item in classLists" :value="item.status" :key="item.student_id">{{item.status}}</Option> -->
      </Select>
      <span>班级</span>
      <Select v-model="grade_name" clearable style="width:200px">
        <Option
          v-for="item in SelectList"
          :value="item.grade_name"
          :key="item.student_id"
        >{{ item.grade_name }}</Option>
      </Select>
    </Card>
    <Card>
      <Table :columns="columns1" :data="classLists.data"></Table>
    </Card>
  </div>
</template>

<script>
import { mapActions, mapState } from 'vuex'
export default {
  data() {
    return {
      grade_name: '',
      status: '',
      haha: {
        value: '',
        label: ''
      },
      columns1: [
        {
          title: '班级名',
          key: 'grade_name'
        },
        {
          title: '姓名',
          key: 'student_name'
        },
        {
          title: '阅卷状态',
          key: 'status'
        },
        {
          title: '开始时间',
          key: 'start_time'
        },
        {
          title: '结束时间',
          key: 'end_time'
        },
        {
          title: '成绩',
          key: 'score'
        },
        {
          title: 'Action',
          key: 'action',
          width: 150,
          align: 'center',
          render: (h, params) => {
            return h('div', [
              h(
                'Button',
                {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  style: {
                    marginRight: '5px'
                  },
                  on: {
                    click: () => {
                      this.toGo(params.row)
                    }
                  }
                },
                '批卷'
              )
            ])
          }
        }
      ]
    }
  },
  computed: {
    ...mapState('waitCheck', ['classLists', 'SelectList'])
  },
  methods: {
    ...mapActions('waitCheck', ['getclassInfo', 'getSelectInfo']),
    // ...mapMutations('waitCheck',['getSelect']),
    toGo(row) {
      console.log(row)
      this.$router.push({
        name: 'paperdetail',
        query: {
          id: row.exam_student_id
        }
      })
      // this.getclassInfo()
    }
  },
  created() {
    this.getSelectInfo()
  }
}
</script>

<style>
</style>
